Fixes to handle 404 exceptions when export policy and ontap volume ar…#73
Open
sandeeplocharla wants to merge 2 commits into
Open
Fixes to handle 404 exceptions when export policy and ontap volume ar…#73sandeeplocharla wants to merge 2 commits into
sandeeplocharla wants to merge 2 commits into
Conversation
suryag1201
reviewed
Jul 9, 2026
| } catch (FeignException.FeignClientException e) { | ||
| } catch (FeignException e) { | ||
| if (e.status() == 404) { | ||
| logger.warn("deleteStorageVolume: Volume '{}' not found in ONTAP (may not have been created), treating as no-op", volume.getName()); |
There was a problem hiding this comment.
we can remove this part "(may not have been created)"
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
f94975a to
5aab5f7
Compare
There was a problem hiding this comment.
Pull request overview
This PR improves resilience of the ONTAP storagepool delete workflow by treating ONTAP “404 Not Found” responses as a no-op when attempting to delete already-missing export policies and volumes, reducing avoidable failures/noise during cleanup.
Changes:
- Handle
FeignExceptionwith HTTP 404 for export policy deletion (NAS) as a no-op. - Handle
FeignExceptionwith HTTP 404 for volume deletion as a no-op. - Minor import reordering/cleanup in the touched classes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedNASStrategy.java | Treats 404 during export policy deletion as a no-op to avoid failing storagepool deletion when the policy is already missing. |
| plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/StorageStrategy.java | Treats 404 during volume deletion as a no-op to avoid failing cleanup when the volume is already missing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
398
to
399
| logger.error("Exception while deleting volume: ", e); | ||
| throw new CloudRuntimeException("Failed to delete volume: " + e.getMessage()); |
Comment on lines
+184
to
+188
| } catch (FeignException e) { | ||
| if (e.status() == 404) { | ||
| logger.warn("deleteAccessGroup: Export policy '{}' not found in ONTAP, treating as no-op", exportPolicyName); | ||
| return; | ||
| } |
Comment on lines
+393
to
+397
| } catch (FeignException e) { | ||
| if (e.status() == 404) { | ||
| logger.warn("deleteStorageVolume: Volume '{}' not found in ONTAP, treating as no-op", volume.getName()); | ||
| return; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes to handle 404 exceptions when export policy and ontap volume are missing during storagepool delete workflow
Description
This PR...
Has fixes to handle 404 Not found exceptions in case of 'ExportPolicy' and 'Volume' deletion.
Screenshots (if appropriate):
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
How Has This Been Tested?
How did you try to break this feature and the system with this change?